<template>
	<view class="content">
		<view class="btns-wrapper">
			<button @tap="loginClick" class="login-btn" type="default">手机号登录</button>
			<button @tap="registeClick" class="registe-btn" type="default">注册</button>
			<text @tap="youkeClick" class="youke-btn">游客模式</text>
			<view class="btns">
				<view @tap="btnClick" class="btns-item" v-for="(item,index) in btnsList" :key="index">
					<image :src="item.url" mode="aspectFit"></image>
					<text>{{item.name}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				btnsList: [
					{name: '微信', url: '../../static/imgs/login/wx-btn.png'},
					{name: 'QQ', url: '../../static/imgs/login/qq-btn.png'},
					{name: '微博', url: '../../static/imgs/login/wb-btn.png'},
					{name: '网易', url: '../../static/imgs/login/wy-btn.png'},
				]
			}
		},
		methods: {
			btnClick() {
				uni.showToast({
					title: '暂无此功能',
					icon:"none",
					mask: true,
					duration: 1000,
					position: 'bottom',
				});
			},
			loginClick() {
				uni.navigateTo({
					url: '/pages/login/login',
				})
			},
			registeClick() {
				uni.navigateTo({
					url: '/pages/login/register',
				})
			},
			youkeClick() {
				var userInfo = {
					nickname: '游客',
					uid: 0,
					avatarUrl: ''
				}
				this.$store.commit('user/SET_USERINFO', userInfo);
				this.$store.commit('user/SET_USERID', userInfo.uid);
				uni.redirectTo({
					url: '/pages/index/main'
				})
			}
		}
	}
</script>

<style lang="scss">
	page,.content{
		width: 100%;
		height: 100%;
	}
	.content{
		background: url("../../static/imgs/login/login-background.png") no-repeat center center;
		background-size: cover;
		.btns-wrapper {
			width: 80%;
			height: 600upx;
			position: absolute;
			left: 50%;
			transform: translateX(-50%);
			bottom: 100upx;
			text-align: center;
			.login-btn{
				border: none;
				background: #ff2d2d;
				border-radius: 80upx;
				color: #fff;
				font-size: 32upx;
				margin-bottom: 40upx;
			}
			.registe-btn{
				border: 1px solid #ff2d2d;
				background: transparent;
				border-radius: 80upx;
				color: #ff2d2d;
				font-size: 32upx;
				margin-bottom: 10upx;
			}
			.youke-btn{
				text-decoration: underline;
				color: #9BB0E2;
				font-size: 30upx;
			}
			.btns{
				display: flex;
				position: absolute;
				left: 0;
				bottom: 0;
				width: 100%;
				height: 140upx;
				justify-content: space-between;
				.btns-item{
					display: flex;
					flex-direction: column;
					justify-content: center;
					font-size: 28upx;
					color: #999;
					image{
						width: 80upx;
						height: 80upx;
						margin-bottom: 10upx;
					}
				}
			}
		}
	}
</style>
